1. Field of the Invention
The present invention is a method of reconfiguring a receiving window size in a communications system, in particular reconfiguring the receiving window size of a receiver of the communications system while avoiding delivering packets that had been previously sent to an upper layer and therefore maintain synchronization in ciphering parameters.
2. Description of the Prior Art
In a wireless communications system, in order to maintain correctly synchronized data packet exchanges between a receiver and a transmitter, a sequence number is normally added to a header of a packet to be transmitted. The receiver is able to compare the sequence number with a sequence number of a next expected packet and determine if the packet received is a correct packet. In general, consecutive packets have consecutive sequence numbers. With different applications, receivers use different methods of adding sequence numbers. For example, a receiver can accumulate sequence numbers of packets to be transmitted, meaning that a sequence number of a packet is a sequence number of a previously received packet plus one. However, as the number of transmitted packets gets large, accumulative sequence numbers of packets to be transmitted become huge and hence affect transmission efficiency. Therefore, when the number of transmitted packets is large, the prior art uses a cyclic method of accumulating sequence numbers. For example, if sequence numbers are represented with 7 bits, then a sequence number starts with 0 and accumulates up to 127. When the sequence number exceeds 127 the sequence number wraps back to 0. Sequence numbers 127 and 0 are considered as consecutive sequence numbers. In some protocol layers, there is an additional hyper frame number (HFN) accumulated each time the 127 wraps back to 0. Therefore, the transmitter and the receiver accumulate the HFN accordingly to keep each other in synchronization, so that following processes, such as ciphering, can be properly executed.
In addition, the transmitter and the receiver comprise a transmitting window and a receiving window respectively for more efficient packet transmission and less packet loss due to noise interference. Taking the receiving window as an example, if a packet received by the receiver is inside the receiving window, then reordering, discarding duplicate packets, or advancing the receiving window can be carried out. If the packet received from the receiver is outside the receiving window, then either the packet is discarded or the receiving window is advanced. Thus, out of order delivery to upper layer can be avoided when packets are received out of order due to noises or other interferences. The receiving window is defined differently for different applications. For instance, for high-speed transmission, in a High Speed Downlink Packet Access (HSDPA), a span of the receiving window is defined by a highest (last) transmission sequence number of received protocol data units. However, if the communications system reconfigures the receiving window size, a transmission error may occur. Please see the following description.
The HSDPA is a technology used in Wideband Code Division Multiple Access (WCDMA) systems to achieve high data rate on the downlink transmission. According to technical specifications, a High Speed Medium Access Control (MAC-hs) entity of the HSDPA comprises four sublayers or entities from bottom to top in order:
1. Hybrid Automatic Repeat Request (HARQ) Entity: generating an acknowledged reporting signal or a negatively acknowledged reporting signal according to a received Protocol Data Unit (PDU) and handling all the tasks that are required for a hybrid ARQ protocol.
2. Re-order Queue Distribution Entity: distributing PDUs to corresponding re-order queues according to queue IDs of PDUs to support transmission data required by different services.
3. Reordering Entity: each reordering entity comprises a re-order queue, the reordering entity reorders PDUs received according to transmission sequence numbers (TSNs). According to the specification of the MAC-hs of the HSDPA, if a previous PDU of a current PDU was not received correctly, the current PDU will not be delivered to its upper layer, i.e., the Disassembly Entity.
4. Disassembly Entity: removing a header and all padding bits of a PDU, and delivering a payload after disassembly to an upper layer (Dedicated Medium Access Control, MAC-d).
According to the specification of the HSDPA, each PDU comprises a 6-bit TSN block to represent TSNs from 0 to 63. When the TSN exceeds 63, the TSN starts with 0 again. The specification of the HSDPA defines the following parameters and variables to specify a size and a span of a receiving window:
1. Parameter RECEIVE_WINDOW_SIZE: represents a size of a receiving window and is defined by the system.
2. Variable next_expected_TSN: represents a TSN of a PDU following a TSN of a last in-sequence PDU received. The next_expected_TSN is updated upon a delivery to the Disassembly Entity layer of a PDU with a TSN equal to the next_expected_TSN. An initial value of the next_expected_TSN is 0.
3. Variable RcvWindow_UpperEdge: represents an upper edge of a receiving window. After a first PDU has been received successfully, RcvWindow_UpperEdge equals a PDU with a highest TSN of all received PDUs.
When performing arithmetic comparisons of the TSNs described above, a 64 modulus operation is used taking (RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE+1), which is also a lower edge of the receiving window, as the modulus base. For example, consider the two consecutive TSNs 63 and 0. Suppose the receiving window lower edge=(RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE+1)=50. Since(63−50) mod 64=13 and(0−50) mod 64=14,
it is known that, for consecutive TSNs, TSN=0 is greater (later) than TSN=63.
As described above, only PDUs with TSNs inside the receiving window are temporarily stored in a reordering buffer where reordering occurs. Therefore, the receiving window size defines a size of a memory required by the reordering buffer and the size of the receiving window is equal to the parameter RECEIVE_WINDOW_SIZE with the receivable TSNs span being from (RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE+1) to RcvWindow_UpperEdge. In prior art, saving the memory size required by the reordering buffer can be achieved by reducing the receiving window size by the system through resetting the parameter RECEIVE_WINDOW_SIZE to be a smaller value. This can be done on line when a re-ordering queue unit is in operation. According to the specification of the MAC-hs of the HSDPA in prior art, when the receiver receives a command for reconfiguring the receiving window size corresponding to a re-ordering queue, the receiver resets the parameter RECEIVE_WINDOW_SIZE according to the command and removes PDUs with TSNs before the receiving window from the reordering buffer and delivers the PDUs to an upper layer (Disassembly Entity). At this moment, it is determined if the next_expected_TSN is less than or equal to a difference between the parameter RcvWindow_UpperEdge and a new parameter RECEIVE_WINDOW_SIZE, meaning determining if (next_expected_TSN≦RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE) is true. If true, first set the parameter next_expected_TSN to be a lower edge of a new receiving window then, deliver received PDUs with consecutive TSNs from the variable next_expected_TSN up to a TSN corresponding to a first not received PDU of the receiver to the upper layer from the buffer of the receiver. Finally, set the variable next_expected_TSN to be the TSN corresponding to the first not received packet.
For example, suppose that a receiver window size is 16 (RECEIVE_WINDOW_SIZE=16) and PDUs with TSN=0 to TSN=25 (inclusive) except 17 are successfully received. In addition, suppose that a PDU with TSN=30 is also received successfully (PDUs with TSN=26 to TSN=29 are not yet received), and PDUs with TSN=0 to TSN=16 are delivered to an upper layer. By prior art, we have: RcvWindow_UpperEdge=30, next_expected_TSN=17 and the receiver window spans from TSN=15 (=30−16+1) to TSN=30. Now, suppose that the network system reconfigures the receiving window size to 8 (RECEIVE_WINDOW_SIZE =8). By prior art, it is known that the receiving window span becomes TSN=23 (=30−8+1) to TSN=30. And delivering PDUs received before a new receiving window to the upper layer means the PDUs with TSN=18 to TSN=22 are delivered to the upper layer. Now, since the variable next_expected_TSN is smaller (with the lower edge of the receiving window, which is 23 at this moment, as a modulus base in a modulus operation) than the difference between the variable RcvWindow_UpperEdge and the new variable RECEIVE_WINDOW_SIZE ((17−23) mod 64<(30−8−23) mod 64), so that the variable next_expected_TSN is set to a new lower edge of the receiving window (next_expected_TSN =23) and, then, PDUs corresponding to TSN=23 to TSN=25 are delivered to the upper layer. Finally set the variable next_expected_TSN to be a TSN of a first not received PDU, which means next_expected_TSN =26.
With the above procedures as the prior art, the HSDPA system is able to reduce the receiving window size and hence effectively use the memory of the reordering buffer. However, in some cases, a method of reconfiguring the receiving window size of the prior art may cause serious problems and transmission errors.
For example, suppose that a receiver window size is 16 (RECEIVE_WINDOW_SIZE =16) and PDUs with TSN=0 to TSN=30 (inclusive) are successfully received and delivered to the upper layer. By the prior art, we have RcvWindow_UpperEdge=30, next_expected_TSN=31 and the receiver window spans from TSN=15 (=30−16+1) to TSN=30. Suppose that the network system reconfigures the receiving window size to 8(RECEIVE_WINDOW_SIZE =8) now. By the prior art, it is known that the receiving window span becomes TSN=23 (=30−8+1) to TSN=30. By a modulus operation with the lower edge of the receiving window to be a modulus base, it is able to determine whether (next_expected_TSN≦RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE) is true. This is determined by calculating (next_expected_TSN−23) mod 64=(31−23) mod 64=8 and (RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE −23) mod 64=(30−8−23) mod 64=63. Since 8<63, (next_expected_TSN≦RcvWindow_UpperEdge−RECEIVE_WINDOW_SIZE) is true. Therefore, the variable next_expected_TSN is set to be the lower edge of the receiving window (next_expected_TSN=23), and PDUs with TSN=23 to TSN=30 are delivered to the upper layer again. Finally the variable next_expected_TSN is set to be a TSN of a first not received PDU, which means next_expected_TSN=31. In other words, the variable next_expected_TSN is set to be 23 from a initial 31 then back to 31 and the PDUs with TSN=23 to TSN=30 are delivered to the upper layer for a second time. In some modes that support duplicate sequence number detection, delivering the PDUs with TSN=23 to TSN=30 again is only wasting system resources and reducing efficiency. For specific operational modes, such as Unacknowledged Mode (UM) which does not support duplicate sequence number detection, TSNs of PDUs delivered again are recognized as sequence number of a next cycle (i.e. HFN is accumulated by 1) causing the transmitter and the receiver ciphering/deciphering parameters to fall out of synchronization and serious errors may occur in deciphered data. Eventually, the system is required to reset the transmitter and the receiver to regain synchronization of the ciphering/deciphering parameters.
In summary, in prior art, when (next_expected_TSN=RcvWindow_UpperEdge+1) is true, i.e., the next expected TSN is equal to the first TSN after the receiving window upper edge, if the system reconfigures the receiving window size, part of PDUs that had been delivered to the upper layer will be delivered again. This not only wastes system resources and reduces efficiency, but also erroneously accumulates the HFN causing the transmitter's and the receiver3 s ciphering/deciphering parameters to be out of synchronization. Finally, the system is required to reset the transmitter and the receiver to recover this error. System performance is deteriorated.